
// import Affix from './libs/iview/components/affix'
// import Alert from './libs/iview/components/alert'
// import BackTop from './libs/iview/components/back-top'
// import Badge from './libs/iview/components/badge'
// import Breadcrumb from './libs/iview/components/breadcrumb'
import Button from './libs/iview/components/button'
// import Card from './libs/iview/components/card'
// import Carousel from './libs/iview/components/carousel'
import Cascader from './libs/iview/components/cascader'
import Checkbox from './libs/iview/components/checkbox'
// import Circle from './libs/iview/components/circle'
import Collapse from './libs/iview/components/collapse'
import DatePicker from './libs/iview/components/date-picker'
// import Dropdown from './libs/iview/components/dropdown'
import Form from './libs/iview/components/form'
import Icon from './libs/iview/components/icon'
import Input from './libs/iview/components/input'
import InputNumber from './libs/iview/components/input-number'
import LoadingBar from './libs/iview/components/loading-bar'
import Menu from './libs/iview/components/menu'
import Message from './libs/iview/components/message'
import Modal from './libs/iview/components/modal'
// import Notice from './libs/iview/components/notice'
import Page from './libs/iview/components/page'
// import Poptip from './libs/iview/components/poptip'
import Progress from './libs/iview/components/progress'
import Radio from './libs/iview/components/radio'
import Rate from './libs/iview/components/rate'
// import Slider from './libs/iview/components/slider'
import Spin from './libs/iview/components/spin'
// import Steps from './libs/iview/components/steps'
// import Switch from './libs/iview/components/switch'
import Table from './libs/iview/components/table'
// import Tabs from './libs/iview/components/tabs'
// import Tag from './libs/iview/components/tag'
import Timeline from './libs/iview/components/timeline'
// import TimePicker from './libs/iview/components/time-picker'
// import Tooltip from './libs/iview/components/tooltip'
// import Transfer from './libs/iview/components/transfer'
// import Tree from './libs/iview/components/tree'
import Upload from './libs/iview/components/upload'
import { Row, Col } from './libs/iview/components/grid'
import { Select, Option, OptionGroup } from './libs/iview/components/select'
// import locale from './libs/iview/locale'

const iview = {
    // Affix,
    // Alert,
    // BackTop,
    // Badge,
    // Breadcrumb,
    // BreadcrumbItem: Breadcrumb.Item,
    // iButton: Button,
    Button,
    // ButtonGroup: Button.Group,
    // Card,
    // Carousel,
    // CarouselItem: Carousel.Item,
    Cascader,
    Checkbox,
    CheckboxGroup: Checkbox.Group,
    // iCircle: Circle,
    DatePicker,
    // Dropdown,
    // DropdownItem: Dropdown.Item,
    // DropdownMenu: Dropdown.Menu,
    Form,
    iForm: Form,
    FormItem: Form.Item,
    Col,
    iCol: Col,
    Collapse,
    Icon,
    Input,
    iInput: Input,
    InputNumber,
    // InputNumber,
    // LoadingBar,
    Menu,
    iMenu: Menu,
    MenuGroup: Menu.Group,
    MenuItem: Menu.Item,
    Submenu: Menu.Sub,
    Message,
    Modal,
    // Notice,
    Option: Option,
    iOption: Option,
    OptionGroup,
    Page,
    Panel: Collapse.Panel,
    // Poptip,
    Progress,
    iProgress: Progress,
    Radio,
    RadioGroup: Radio.Group,
    Rate,
    Row,
    Select,
    iSelect: Select,
    // Slider,
    Spin,
    // Step: Steps.Step,
    // Steps,
    // // Switch,
    // iSwitch: Switch,
    iTable: Table,
    Table,
    // Tabs: Tabs,
    // TabPane: Tabs.Pane,
    // Tag,
    Timeline,
    TimelineItem: Timeline.Item,
    // TimePicker,
    // Tooltip,
    // Transfer,
    // Tree,
    Upload,
}

const install = function(Vue, opts = {}) {
    // locale.use(opts.locale)
    // locale.i18n(opts.i18n)

    Object.keys(iview).forEach((key) => {
        Vue.component(key, iview[key])
    })

    Vue.prototype.$Loading = LoadingBar
    Vue.prototype.$Message = Message
    Vue.prototype.$Modal = Modal
    // Vue.prototype.$Notice = Notice
}

// auto install
if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue)
}

module.exports = Object.assign(iview, {install})   // eslint-disable-line no-undef
